// 显示 Toast 消息
function showToast(message, type = 'info') {
    // 初始化 Toast
    const toastEl = document.getElementById('toast');
    const toast = new bootstrap.Toast(toastEl);
    const toastBody = toastEl.querySelector('.toast-body');
    toastBody.textContent = message;
    toastEl.classList.remove('bg-info', 'bg-success', 'bg-danger');
    if (type === 'success') {
        toastEl.classList.add('bg-success', 'text-white');
    } else if (type === 'error') {
        toastEl.classList.add('bg-danger', 'text-white');
    } else {
        toastEl.classList.add('bg-info', 'text-white');
    }
    toast.delay = 1; // 0.5秒后消失
    toast.show();
}

export{showToast}
